// var webpack = require("webpack");
module.exports = {
  publicPath: "./",
  configureWebpack: {
    externals: {
      babylonjs: "BABYLON",
      BMap: "BMap",
      BMapGL: "BMapGL",
      mapv: "mapv",
      mapvgl: "mapvgl",
      mapboxgl: "mapboxgl",
      MapboxLanguage: "MapboxLanguage"
    },
      devServer: {
          proxy: 'http://localhost:8080',
          public: 'localhost:8080'  // 本地ip
      },
    // resolve
    // resolve: {
    //   alias: {
    //     cesium: path.resolve(__dirname, "../node_modules/cesium/Source")
    //   }
    // },
    // plugins
    plugins: [
      // new webpack.ProvidePlugin({
      //   mapboxgl: "mapbox-gl"
      // })
      // new HtmlWebpackPlugin({
      //   template: "src/index.html"
      // }),
      // Copy Cesium Assets, Widgets, and Workers to a static directory
      // new CopyWebpackPlugin([
      //   {
      //     from: path.join(
      //       "node_modules/cesium/Source",
      //       "../Build/Cesium/Workers"
      //     ),
      //     to: "Workers"
      //   }
      // ]),
      // new CopyWebpackPlugin([
      //   {
      //     from: path.join("node_modules/cesium/Source", "Assets"),
      //     to: "Assets"
      //   }
      // ]),
      // new CopyWebpackPlugin([
      //   {
      //     from: path.join("node_modules/cesium/Source", "Widgets"),
      //     to: "Widgets"
      //   }
      // ]),
      // new webpack.DefinePlugin({
      //   // Define relative base path in cesium for loading assets
      //   CESIUM_BASE_URL: JSON.stringify("")
      // })
    ]
  }
};
